﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    
    x:Class="ontheroad.MainPage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="728"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="false">
	<phone:PhoneApplicationPage.Resources>
		<Style x:Key="Buttoncongestion" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock1" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<StackPanel Orientation="Horizontal" d:LayoutOverrides="Height">
								<Image HorizontalAlignment="Left" Height="80" Source="icons/congestionicon.png" Stretch="Fill" Width="80" VerticalAlignment="Center"/>
								<StackPanel Margin="10,0,0,0">
									<TextBlock x:Name="textBlock" TextWrapping="Wrap" Text="traffic congestion" Margin="10,0,0,0"/>
									<TextBlock x:Name="textBlock1" TextWrapping="Wrap" Foreground="#FF707070" FontFamily="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK" FontSize="37.333" Margin="10,-8,0,0" Text="ตรวจสอบสภาพจราจร"/>
								</StackPanel>
							</StackPanel>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontFamily" Value="Segoe WP Semibold"/>
			<Setter Property="FontSize" Value="40"/>
			<Setter Property="Foreground" Value="Black"/>
		</Style>
		<Style x:Key="trafficnewsbut" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<StackPanel Orientation="Horizontal">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock1" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image HorizontalAlignment="Left" Height="80" Source="icons/trafficnewsicon.png" Stretch="Fill" Width="80" VerticalAlignment="Center"/>
							<StackPanel Margin="10,0,0,0" Width="359">
								<TextBlock x:Name="textBlock1" TextWrapping="Wrap" Text="traffic news" Margin="10,0,0,0" Foreground="Black"/>
								<TextBlock x:Name="textBlock" TextWrapping="Wrap" Foreground="#FF707070" FontFamily="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK" FontSize="37.333" Margin="10,-8,0,0" Text="ตรวจสอบข่าวเกี่ยวกับสภาพจราจร"/>
							</StackPanel>
						</StackPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontFamily" Value="Segoe WP Semibold"/>
			<Setter Property="FontSize" Value="40"/>
			<Setter Property="Foreground" Value="Black"/>
		</Style>
		<Style x:Key="intelsignbut" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<StackPanel Orientation="Horizontal">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock1" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image HorizontalAlignment="Left" Height="80" Source="icons/intsignicon.png" Stretch="Fill" Width="80" VerticalAlignment="Center"/>
							<StackPanel Margin="10,0,0,0">
								<TextBlock x:Name="textBlock1" TextWrapping="Wrap" Text="check signs" Margin="10,0,0,0" Foreground="Black"/>
								<TextBlock x:Name="textBlock" TextWrapping="Wrap" Foreground="#FF707070" FontFamily="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK" FontSize="37.333" Margin="10,-8,0,0"><Run Text="ตรวจสอบ"/><Run Text="ป้ายจราจรอัจฉริยะ"/></TextBlock>
							</StackPanel>
						</StackPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontFamily" Value="Segoe WP Semibold"/>
			<Setter Property="FontSize" Value="40"/>
			<Setter Property="Foreground" Value="Black"/>
		</Style>
		<Style x:Key="cctvbut" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<StackPanel Orientation="Horizontal">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock1" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image HorizontalAlignment="Left" Height="80" Source="icons/cctvicon.png" Stretch="Fill" Width="80" VerticalAlignment="Center"/>
							<StackPanel Margin="10,0,0,0">
								<TextBlock x:Name="textBlock1" TextWrapping="Wrap" Text="check cctv" Margin="10,0,0,0" Foreground="Black"/>
								<TextBlock x:Name="textBlock" TextWrapping="Wrap" Foreground="#FF707070" FontFamily="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK" FontSize="37.333" Margin="10,-8,0,0"><Run Text="ตรวจสอบ"/><Run Text="ภาพจากกล้อง "/><Run Text="cctv"/></TextBlock>
							</StackPanel>
						</StackPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontFamily" Value="Segoe WP Semibold"/>
			<Setter Property="FontSize" Value="40"/>
			<Setter Property="Foreground" Value="Black"/>
		</Style>
		<Style x:Key="favoritebut" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<StackPanel Orientation="Horizontal">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock1" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image HorizontalAlignment="Left" Height="80" Source="icons/favoriteicon.png" Stretch="Fill" Width="80" VerticalAlignment="Center"/>
							<StackPanel Margin="10,0,0,0">
								<TextBlock x:Name="textBlock1" TextWrapping="Wrap" Text="my directions" Margin="10,0,0,0" Foreground="Black"/>
								<TextBlock x:Name="textBlock" TextWrapping="Wrap" Foreground="#FF707070" FontFamily="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK" FontSize="37.333" Margin="10,-8,0,0" Text="ถนนหรือเส้นทางประจำ"/>
							</StackPanel>
						</StackPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontFamily" Value="Segoe WP Semibold"/>
			<Setter Property="FontSize" Value="40"/>
			<Setter Property="Foreground" Value="Black"/>
		</Style>
	</phone:PhoneApplicationPage.Resources>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar x:Name="mainappbar" BackgroundColor="{StaticResource PhoneAccentColor}" ForegroundColor="White" IsVisible="True">
			<shell:ApplicationBarIconButton x:Name="helpbut" IconUri="/icons/appbar.questionmark.rest.png" Text="about" Click="helpbut_Click"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0,0,0,20" Orientation="Vertical">
        	<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0">
        		<TextBlock Margin="0" TextWrapping="Wrap" Text="on" FontFamily="Segoe WP SemiLight" HorizontalAlignment="Right" FontSize="66.667" VerticalAlignment="Center" FontWeight="Bold">
        		<TextBlock.Foreground>
        			<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
        		</TextBlock.Foreground>
        	</TextBlock>
        	<TextBlock TextWrapping="Wrap" Text="theroad" VerticalAlignment="Center" FontFamily="Segoe WP" FontSize="66.667" Margin="0" FontWeight="Bold">
        		<TextBlock.Foreground>
        			<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
        		</TextBlock.Foreground>
        	</TextBlock>     	
			</StackPanel>
        	<TextBlock Text="TRAFFIC IN YOUR HAND" Foreground="Black" FontFamily="Segoe WP Black" FontSize="25.333" Margin="0,-13,0,0" d:LayoutOverrides="Width" HorizontalAlignment="Center"/>
			<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,15,0,0" Visibility="Collapsed">
				<Ellipse Fill="#FFF91414" Height="15" Stroke="#00000000" Width="15" StrokeThickness="0" HorizontalAlignment="Center"/>
				<Ellipse Fill="#FFFFF000" Height="15" Stroke="#00000000" Width="15" StrokeThickness="0" HorizontalAlignment="Center" Margin="10,0,0,0"/>
				<Ellipse Fill="#FF94C947" Height="15" Stroke="#00000000" Width="15" StrokeThickness="0" HorizontalAlignment="Center" Margin="10,0,0,0"/></StackPanel>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="20,0,12,0">
        	<StackPanel Margin="0,20,0,0">
        		<Button x:Name="congestionbut" Content="traffic congestion" Style="{StaticResource Buttoncongestion}">
        			
        			<i:Interaction.Triggers>
        				<i:EventTrigger EventName="Click">
        					<ic:NavigateToPageAction TargetPage="/trfCongestion.xaml"/>
        				</i:EventTrigger>
        			</i:Interaction.Triggers>
        			
        		</Button>
        		<Button x:Name="newsbut" Content="traffic news" Margin="0,10,0,0" Style="{StaticResource trafficnewsbut}">
        			<i:Interaction.Triggers>
        				<i:EventTrigger EventName="Click">
        					<ic:NavigateToPageAction TargetPage="/trfNews.xaml"/>
        				</i:EventTrigger>
        			</i:Interaction.Triggers>
        		</Button>
        		<Button x:Name="intelsignbut" Content="" Margin="0,10,0,0" Style="{StaticResource intelsignbut}">
        			<i:Interaction.Triggers>
        				<i:EventTrigger EventName="Click">
        					<ic:NavigateToPageAction TargetPage="/intsignlist.xaml"/>
        				</i:EventTrigger>
        			</i:Interaction.Triggers>
        		</Button>
        		<Button x:Name="cctvbut" Content="check cctv" Margin="0,10,0,0" Style="{StaticResource cctvbut}">
        			<i:Interaction.Triggers>
        				<i:EventTrigger EventName="Click">
        					<ic:NavigateToPageAction TargetPage="/cctvlist.xaml"/>
        				</i:EventTrigger>
        			</i:Interaction.Triggers>
        		</Button>
        	</StackPanel></Grid>
        <Grid x:Name="waitScr" Background="#CC000000" Grid.RowSpan="2" Visibility="Visible" d:IsHidden="True">
        	<ProgressBar Height="30" VerticalAlignment="Center" IsIndeterminate="True" Margin="0"/>
        	<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="connecting server..." FontFamily="Segoe WP SemiLight" FontSize="34.667" Margin="0,295,0,0" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment">
        		<TextBlock.Foreground>
        			<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
        		</TextBlock.Foreground>
        	</TextBlock>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>